---
title: 
- Replication package for Karreth & Tir (JPR)
subtitle:
- "International Agreement Design and the Moderating Role of Domestic Bureaucratic Quality: The Case of Freshwater Cooperation"
author: 
- Johannes Karreth
- Jaroslav Tir
date: 
- November 2017

output:
  rmdformats::readthedown:
    highlight: default
    smart: false
---

This folder contains all data and code to reproduce the analyses in:

> Karreth, Johannes and Jaroslav Tir. Forthcoming. "The Economic Leverage of International Organizations in Interstate Disputes." *Journal of Peace Research*. [doi:10.1177/0022343317749271](https://doi.org/10.1177/0022343317749271)

This document makes reference to the supporting information (SI), which is part of this replication package and also posted at <http://www.jkarreth.net>. For any questions, please contact the corresponding author at <jkarreth@ursinus.edu>.

The R script `1_analyses.R` performs the following:

- compiling the data for analysis
- reading the data into R and recoding some variables for analysis
- conducting the analyses in the article and supporting information (`karreth.tir.jpr.SI.pdf`)

All tables and figures produced by these scripts are written to a folder named "Output", which needs to be created before beginning the analyses.

All raw datasets needed to create the data for analyses must be provided in the same directory as the R script (or within the same working directory).

# Data sources

Data sources are discussed and cited in the article. The files in the replication package are:

- `basins_small.csv`: Core dataset, containing information coded by the authors and other variables added as described in the main text
- `dyadicmid2.0.dta`: Dyadic MID Dataset (version 2.0). Citation: Maoz, Zeev. 2005. Dyadic MID Dataset (version 2.0): <http://vanity.dss.ucdavis.edu/~maoz/dyadmid.html>
- `EventMaster111710.csv`: International Water Event Database: 1950-2008. Citation: Product of the Transboundary Freshwater Dispute Database, College of Earth, Ocean, and Atmospheric Sciences, Oregon State University.  Additional information about the TFDD can be found at: <http://www.transboundarywaters.orst.edu>
- `IGO_dyadunit_v2.3.RData`: COW IGO data, dyad-unit. Citation: Pevehouse, Jon C., Timothy Nordstrom, and Kevin Warnke. 2004. "The COW-2 International Organizations Dataset Version 2.0" *Conflict Management and Peace Science* 21 (2): 101-119.
- `oecd_members.csv`: List of OECD member states, compiled by Johannes Karreth
- `rtd_dyad-year.csv` and `rtd_treaty-country-year.csv`: Data on river treaty institutionalization at the dyad-year and treaty-country-year levels. Both files are based on previous versions originally compiled by Jaroslav Tir and Doug Stinnett. Those early versions were derived from the TFDD International Freshwater Treaties Database at <http://www.transboundarywaters.orst.edu/database/interfreshtreatdata.html>. The data were then revised by Johannes Karreth in 2013-2014. Information from <http://www.transboundarywaters.orst.edu/database/Treaty%20Database%20Design%20(with%20descriptions).doc> was used to recover information on most variables. Information on specific variables in the file `rtd_treaty-codebook.pdf`.
- `TM_WORLD_BORDERS_SIMPL-0.3`: Shape file for world map, provided by Bjorn Sandvik, <http://www.thematicmapping.org>

# Software information

All analyses using R were executed on R version 3.4.2 (2017-09-28) on macOS Sierra 10.12.6; a list of packages and versions used is at the end of this file. Analyses using Stata were executed on Stata/SE 13.1 for Mac (64-bit Intel), Revision 16 Dec 2016.

```
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] RColorBrewer_1.1-2      rgdal_1.2-15            maps_3.2.0              maptools_0.9-2         
 [5] sp_1.2-5                systemfit_1.1-20        lmtest_0.9-35           zoo_1.8-0              
 [9] car_2.1-5               RStata_1.1.1            Formula_1.2-2           directlabels_2017.03.31
[13] bindrcpp_0.2            countrycode_0.19        rio_0.5.5               ggplot2_2.2.1          
[17] effects_4.0-0           carData_3.0-0           gridExtra_2.3           dplyr_0.7.4            
[21] xtable_1.8-2            lme4_1.1-14             Matrix_1.2-11           texreg_1.36.23         
[25] foreign_0.8-69         

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13        bdsmatrix_1.3-2     lattice_0.20-35     assertthat_0.2.0   
 [5] digest_0.6.12       R6_2.2.2            cellranger_1.1.0    plyr_1.8.4         
 [9] MatrixModels_0.4-1  survey_3.32-1       rlang_0.1.2         lazyeval_0.2.1     
[13] curl_3.0            readxl_1.0.0        minqa_1.2.4         data.table_1.10.4-3
[17] SparseM_1.77        nloptr_1.0.4        labeling_0.3        splines_3.4.2      
[21] readr_1.1.1         bit_1.1-12          munsell_0.4.3       compiler_3.4.2     
[25] pkgconfig_2.0.1     mgcv_1.8-22         nnet_7.3-12         tibble_1.3.4       
[29] quadprog_1.5-5      MASS_7.3-47         grid_3.4.2          nlme_3.1-131       
[33] gtable_0.2.0        magrittr_1.5        scales_0.5.0        plm_1.6-5          
[37] sandwich_2.4-0      openxlsx_4.0.17     tools_3.4.2         forcats_0.2.0      
[41] bit64_0.9-7         glue_1.2.0          hms_0.3             pbkrtest_0.4-7     
[45] parallel_3.4.2      survival_2.41-3     yaml_2.1.14         colorspace_1.3-2   
[49] gpclib_1.5-5        bindr_0.1           haven_1.1.0         quantreg_5.34
```
